import { useSelector, useDispatch } from 'react-redux'
import { decrement } from './store/actions'
export default function Test() {
  // 展示 Redux 中的状态 10，点击按钮减去 8
  const count = useSelector((state) => state.counter)
  const dispatch = useDispatch()
  return (
    <div>
      <h3>{count}</h3>
      <button onClick={() => dispatch(decrement(8))}>-8</button>
    </div>
  )
}
